﻿
using System;

using System.Globalization;
using System.Windows;
using System.Windows.Data;

namespace be.metanous.mvvm.converters
{
    public class InverseEnumToCollapsedVisibilityConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {

            if (DependencyProperty.UnsetValue.Equals(value))
            {
                return System.Windows.Visibility.Visible; 
            }


            if (value != null)
            {
                if (value.Equals(parameter))
                {
                    return System.Windows.Visibility.Collapsed;
                }
            }
            return System.Windows.Visibility.Visible;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
           throw new NotImplementedException();
        }
    }
}
